import rclpy
from rclpy.node import Node
import threading
#import time

class Mynode(Node):
    def __init__(self):
        super().__init__("rate_node_py")
        self.demo_rate()
    def demo_rate(self):
        self.rate=self.create_rate(1)
        thread=threading.Thread(target=self.do_some)
        thread.start()
    def do_some(self):
        while rclpy.ok():
            self.get_logger().info("++++++++++++++++++++++")
            self.rate.sleep()
            #time.sleep(1.0)

def main():
    rclpy.init()
    rclpy.spin(Mynode())
    rclpy.shutdown()

if __name__=='__main__':
    main()
